home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / PAUSE11.QM < prev    next >
Text File  |  1991-08-26  |  15KB  |  309 lines

  1. *                               PAUSE11.QM
  2. *                      Macros To Single Step Macros
  3. *                        Written by Tom Hogshead
  4. *                   With Contributions by John Goodman
  5. *                                 8/9/91
  6. *
  7. *     @(1) Single Step Macro By Adding PAUSE Lines Between Macro Commands |chg
  8. *
  9. *     @(2) Remove PAUSE Lines Between Macro Commands Placed With @1
  10. *
  11. *     @(3) Macro @2 Paused With @1, Removes PAUSES "Single Step"
  12. *
  13. *     @(4) Adds A PAUSE*+ Above The Cursor Line, or Comments/Uncomments
  14. *          a PAUSE*+ Line
  15. *
  16. *        (Description)
  17. *        (AMACxx).ZIP
  18. *        (Problems) or suggestions?
  19. *        (Version) History
  20. *
  21. *-- eoi
  22.  
  23.  
  24. *  (Description)
  25. *  -------------
  26.  
  27. *   PAUSE11.QM macros make any portion of a QEdit macro marked as a
  28. *   block a "single step" macro by entering a "pause" before the each
  29. *   macro command in the block.  Macros are included to revert a single
  30. *   step macro to normal operation.
  31.  
  32.  
  33. * 
  34. *  (AMACxx).ZIP Sources
  35. *   --------------------
  36.  
  37. *   AMACxx.ZIP is a collection of QEdit  macros I have put together.
  38. *   Many I   have   written,  and  John   Goodman  has   recently
  39. *   contributed extensively to this  effort.  As of this  writing, the
  40. *   latest version is xx=38 with new macros and subsequent changes in
  41. *   AMAC-x.ZIP(x = K) Program files used with these  macros are in
  42. *   AMAC-PRG.ZIP.  AMACxx.ZIP is (uploaded) to   CompuServe IBMAPP Lib
  43. *   0  (Lib 1  after 30 days in Lib 0), Exec-PC  (414-789-4210), and
  44. *   SemWare  (404-641-8968).  All are PC "Pursuitable" except
  45. *   CompuServe.
  46.  
  47. * 
  48. *  (Problems) or suggestions?
  49. *   --------------------------
  50.  
  51. *   Any problems  or suggestion,  I would like to  hear from  you.  I
  52. *   can be reached daily on either  SemWare,  Exec-PC  or  NewWare.   I
  53. *   check CompuServe only once a month.  I will also try to include
  54. *   your useful macros in AMAC  if you send them to me.  Hope you  find
  55. *   some of these macros useful.  I have enjoyed writing them.  Thanks.
  56.  
  57. *   Tom Hogshead
  58.  
  59. * 
  60. * ----------------------------------------------------------------------
  61. * @(1) Single Step Macro By Adding PAUSE Lines Between Macro Commands
  62. * ----------------------------------------------------------------------
  63.  
  64. * This macro makes any portion of a macro marked as a block a 'single
  65. * step' macro by entering a 'pause' before the each macro command in
  66. * the block.  To run, place the cursor line on the first line of the
  67. * block, execute the macro, and at the pause, cursor down to the
  68. * desired end of block and hit Enter.  Alternatively, the block may be
  69. * marked (open or closed) before execution as either a line, column or
  70. * character block.
  71.  
  72. * Insert may be ON or OFF.  Lines containing a colon are assumed Labels
  73. * and are not paused.  Macro stops if any blank line exists in block.
  74. * Lines containing Pause with capital 'P' will not be paused, but pause
  75. * without capital P will be paused.  User inserted pauses should have
  76. * the 'P' capitalized to not be paused with @1.  Lines containing
  77. * PAUSE*+ will not be paused.  Conditional lines containing jtrue,
  78. * jfalse and jump are assumed to be followed on the same line by a
  79. * Label *with* a colon and are not paused, e.g.  'jtrue LABEL1:' is not
  80. * paused, but 'jtrue' with the label on the following line is.
  81.  
  82. @1 macrobegin
  83. * ------- Check and finish marking line or block if not marked -------*
  84.     gotoblockend                * Test if block is closed
  85.     jtrue OK:                   * If closed, go to OK
  86.     markline                    * If not closed, close or start mark
  87.     gotoblockend                * Move to end of block if closed or stay
  88.                                 *  where we are if block not yet closed
  89.     jtrue OK:                   * If block is now closed, we started with
  90.                                 *  an open block
  91.     makectrofscreen             * Center for viewing
  92.     Pause                       * Pause to mark end of block
  93.     markline                    * Mark end of block
  94.  OK:                            *
  95. * ------------------ Insert blank line under block ------------------*
  96.     cursordown                  * Move down to line under block
  97.     insertline                  * Add blank line
  98. * ------------------ Insert message on top of block ------------------*
  99.  BEGIN:                         *
  100.     gotoblockbeg                * Go back to block begin
  101.     unmarkblock                 * Un mark block
  102.     begline                     * Start message in col 1
  103.     insertline                  * Insert blank line on top of block for msg
  104.     #42                         * Insert star in col 1
  105.     cursorright                 * Move right one space
  106.     "-" 8                       * Insert '-' 9 times
  107.     "BEGIN PAUSE"               * Insert begin message
  108.     wordleft                    * Move cursor to P
  109.     markcharacter               * Start character marking
  110.     endline                     *
  111.     #42 "+"                     * Inert '*+'
  112.     storescrbuff "1" return     * Store 'PAUSE_*+' to scratch buff 1
  113.     markline                    * Markline for copy
  114.     copy                        * Copy
  115.     cursordown                  * Move to first line in block
  116.     cursordown                  * Move to second line in block
  117. * --------------------- Test if at end of block ---------------------*
  118.  LOOP:                          * Come here to loop
  119.     unmarkblock                 * Unmark line/block
  120.     endline begline             * Test if line is blank
  121.     jfalse END:                 * If so, macro ends on first blank line
  122. * --------------- Test if star is first character in line-------------*
  123.     insertline                  * Insert temp line
  124.     nextpara                    * Move to first character of line below
  125.     cursorup delline            * Delete temp line
  126.     scrollup                    * Re-position screen because of delete
  127.     cursorright                 * Move right one space off first character
  128.     markline                    * Mark this line to begin all tests
  129.     FIND #42 return "LB" return * Search for star, Local Backwards
  130.     jtrue 1:                    * If false, no comment in line, go pause
  131. * ----------- Test if conditional statement or label (colon) -----------*
  132.     begline                     * In case previous line contained comments
  133.     Find #58  return            * Search for colon #58
  134.     "L" return                  *  in this line only, "Local"
  135.     Jtrue 1:                    * If colon found, line assumed to be a
  136.                                 *  conditional statement or Label, bypass
  137. * -------------------- Test if line is already a 'pause' -------------*
  138.     begline                     *ELSE line has no colon, position to Test
  139.     Find #80 "ause" return      * Test if line is already a paused
  140.     "WL" return                 *  Finds whole word pause, with cap P
  141.     jtrue 2:                    * If found, line is a pause, bypass this
  142.                                 *  and next line
  143. * -------------- Test if line is already paused with @1 --------------*
  144.     begline                     *ELSE line has no colon, position to Test
  145.     Find "E" "*+" return        * Test if line is already paused with @1
  146.     "L" return                  *  Finds 'PAUSE_*+', all caps
  147.     jtrue 2:                    * If found, line was paused with @1,
  148.                                 *  bypass this and next line
  149. * --------------------- Test if line has Repeat_Cmd --------------------*
  150.     begline                     * In case previous line contained comments
  151.     Find "atcm"  return         * Search for Repeat_Cmd
  152.     "IL" return                 *  in this line only, Local, Case Insensitive
  153.     Jtrue 1:                    * If  found, line, bypass this line
  154. * ----------------------- Insert 'pause' line -----------------------*
  155.  3:                             *
  156.     insertline                  * Need to insert a blank line to 'pause'
  157.     Gotocolumn  "25" return     * Go to column 25 (change as you like)
  158.     getscrbuff "1" return       * Insert needed 'PAUSE_*+' from scratch
  159.  2:                             *
  160.     cursordown                  * Bypass line, move down to next line
  161.  1:                             *
  162.     cursordown                  * Move down to next line to test if blank
  163.     endline begline             * Test if line is blank
  164.     jfalse END:                 * If so, blank line ends macro
  165.     jump LOOP:                  *ELSE loop again
  166.  END:                           * End macro
  167. * -------------------- Insert message under block --------------------*
  168.     paste                       * Paste Begin message here
  169.     endline                     * Move to eol
  170.     wordleft wordleft           * Move to B in BEGIN
  171.     delrtword                   * Delete BEGIN
  172.     splitline                   * In case Insert Off                        |a
  173.     "END "                      * BEGIN now replaced with END,
  174.                                 * Insert must ON
  175.     joinline                    * Re-join                                   |a
  176.     unmarkblock                 *
  177. *
  178. * 241 bytes Wed  05-29-1991  21:20:35 (TH to JG)
  179. * 207 bytes Tue  06-04-1991  00:39:02 (TH implemented JG suggestions)
  180. * 194 bytes Tue  06-04-1991  10:38:13 (TH shortened test for comments)
  181. * 194 bytes Sun  06-23-1991  20:59:30 (TH changed find first char on line)
  182. * 194 bytes Mon  07-08-1991  17:16:28 (TH @1)
  183. * 196 bytes Fri  08-09-1991  02:01:44 (TH @1, in pause11.qm, Ins Off Ok |a )
  184.  
  185. * 
  186. * ----------------------------------------------------------------------
  187. * @(2) Remove PAUSE Lines Between Macro Commands Placed With @1
  188. * ----------------------------------------------------------------------
  189.  
  190. * This macro removes all and only pauses placed with @1 from the cursor
  191. * line to the next blank line.  If no PAUSE_*+ are found after starting
  192. * this macro, the macro deletes the next blank line it finds and stops.
  193. * Just beware.
  194.  
  195. @2 macrobegin
  196.  LOOP:
  197.     endline begline             * Test if line has text                   |
  198.     jfalse DELLINE:             * If blank, END macro                     |
  199.     unmarkblock markline        * Markline for Find                       |
  200.     Find  "E" "*+" return       * Search for 'PAUSE_*+'
  201.     "L" return                  * Finish prompt                           |
  202.     jfalse NOPAUSE:             * If not found, go to NOPAUSE
  203.     delline                     *ELSE if found, delete pause line
  204.     begline                     * Re-position for Find on current line
  205.     jump LOOP:                  * Loop again
  206.  NOPAUSE:                       *
  207.     endline begline             * Test if line has text
  208.     jfalse DELLINE:             * If blank, delete line and end macro
  209.     unmarkblock                 * Only for better screen appearance       |
  210.     cursordown                  *ELSE cursor down to next line
  211.     JFALSE END:                 * End macro if can't cursor down bottom line
  212.     jump LOOP:                  * Loop again
  213.  DELLINE:                       *
  214.     delline                     * Delete blank line
  215.  END:                           *
  216.     unmarkblock                 *                                         |
  217. *
  218. * 36 bytes Tue  06-04-1991  00:26:13 (TH)
  219. * 44 bytes Tue  06-04-1991  10:14:23 (TH |)
  220. * 45 bytes Mon  07-08-1991  17:16:43 (TH @2)
  221.  
  222. * 
  223. * ----------------------------------------------------------------------
  224. * @(3) Macro @2 Paused With @1, Removes PAUSES "Single Step"
  225. * ----------------------------------------------------------------------
  226.  
  227. * This macro is macro @2 paused with @1.
  228.  
  229. @3 macrobegin
  230. * --------BEGIN PAUSE*+
  231.     begline                     * In case cursor past 'PAUSE_*+' on line
  232.                         PAUSE*+
  233.  LOOP:
  234.                         PAUSE*+
  235.     Find "E" "*+" return        * Search for 'PAUSE_*+' (all capitals)
  236.                         PAUSE*+
  237.     delline return              * Finish prompt
  238.     jfalse NOPAUSE:             * If nor found, go to NOPAUSE
  239.                         PAUSE*+
  240.     delline                     *ELSE if found, delete pause line
  241.     jump LOOP:                  * Loop again
  242.  NOPAUSE:                       *
  243.                         PAUSE*+
  244.     endline begline             * Test if line has text
  245.     jfalse DELLINE:             * If blank, delete line and end macro
  246.                         PAUSE*+
  247.     cursordown                  *ELSE cursor down to next line
  248.     JFALSE END:                 * End macro if can't cursor down bottom line
  249.     jump LOOP:                  * Loop again
  250.  DELLINE:                       *
  251.                         PAUSE*+
  252.     delline                     * Delete blank line
  253.  END:                           *
  254. * --------END PAUSE*+
  255.  
  256. * 42 bytes Fri  05-31-1991  22:13:40 (TH)
  257. * 42 bytes Mon  07-08-1991  17:16:52 (TH @3)
  258.  
  259.  
  260. * 
  261. * ----------------------------------------------------------------------
  262. * @(4) Adds A PAUSE_*+ Above The Cursor Line, or Comments/Uncomments
  263. *      a PAUSE_*+ Line
  264. * ----------------------------------------------------------------------
  265.  
  266. * This macro either adds a PAUSE_*+ above the cursor line, or
  267. * comments/ uncomments a PAUSE_*+ line.
  268.  
  269. @4  macrobegin
  270.     unmarkblock                 *
  271.     begline                     *
  272.     markline                    *
  273.     Find "*" " P" return        * Test if pause commented
  274.     "L" return                  *  Locally
  275.     jfalse DO:                  * If false, commented pause does not exist
  276.     delch                       *ELSE, it exists, delete star
  277.     shiftright                  * Put pause back in original position
  278.     jump END:                   * END macro
  279.  DO:                            *
  280.     Find "E" "*+" return        * Test if 'pause' with '*+' exists
  281.     "L" return                  *  Locally
  282.     jfalse ADD:                 * If it does not, we must add pause
  283.     wordleft                    *ELSE 'pause' with '*+' exists
  284.     shiftright                  * Shift it and line right one space
  285.     "*"                         * Insert star
  286.     shiftleft shiftleft         * Put back in original position if Insert ON
  287.     jump END:                   * END macro
  288.  ADD:                           *
  289.     insertline                  * Insert line above for 'pause'
  290.     Gotocolumn "25" return      * Go to column 25 (change as you like)
  291.     "PAUSE" "*+"                * Insert 'pause' with '*+'
  292.     cursordown                  * Cursor down to line we just paused
  293.  END:                           *
  294.     begline                     *
  295.     unmarkblock                 *
  296. *
  297. * 73 bytes Tue  06-04-1991  02:04:12 (TH)
  298. * 73 bytes Mon  07-08-1991  17:17:12 (TH @4)
  299.  
  300.  
  301. * (Version) History
  302. * ------------------
  303. *   1.0 -   Initial release.                                           7/10/91
  304. *   1.1 -   Modified @1 for Insert On or Off.                           8/9/91
  305. *
  306. *
  307. *
  308. *
  309.